package com.szz.cardecision.service;

import com.szz.cardecision.entity.Consultation;
import com.szz.cardecision.entity.User;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LLMService {
    private final List<LLMProvider> providers;

    public LLMService(List<LLMProvider> providers) {
        this.providers = providers;
    }

    public String generateCombinedAdvice(User user, Consultation consultation) {
        StringBuilder sb = new StringBuilder();
        for (LLMProvider p : providers) {
            sb.append("=== 来自 ").append(p.name()).append(" 的建议 ===\n");
            sb.append(p.generateAdvice(user, consultation)).append("\n\n");
        }
        return sb.toString();
    }
}